<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    </title>隔行变色</title>
    <script type="text/javascript">
        $(function () {
            //选择奇数行，变色
            $("tr:odd").css("backgroundColor","red");
            $("tr:even").css("backgroundColor", "green");

        });
    </script>

</head>
<body>
<table border="1" width="800px">

    <tr>
        <td>1</td>
        <td>姓名</td>
        <td>囚牛</td>
    </tr>
    <tr>
        <td>2</td>
        <td>姓名</td>
        <td>睚眦</td>
    </tr>
    <tr>
        <td>3</td>
        <td>姓名</td>
        <td>嘲风</td>
    </tr>
    <tr>
        <td>4</td>
        <td>姓名</td>
        <td>蒲牢</td>
    </tr>
    <tr>
        <td>5</td>
        <td>姓名</td>
        <td>狻猊（suanni）</td>
    </tr>
    <tr>
        <td>6</td>
        <td>姓名</td>
        <td>赑屃（bixi）</td>
    </tr>
    <tr>
        <td>7</td>
        <td>姓名</td>
        <td>狴犴（bi‘an）</td>
    </tr>
    <tr>
        <td>8</td>
        <td>姓名</td>
        <td>负屃（fu'xi）</td>
    </tr>
    <tr>
        <td>9</td>
        <td>姓名</td>
        <td>螭吻（chi'wen）</td>
    </tr>
</table>
</body>
</html>